﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace TookKit.Mvvm.Interfaces
{
    public interface IContainer
    {
        /// <summary>
        /// 模块管理器，负责添加模块和初始化模块
        /// </summary>
        IModuleManager ModuleManager { get; }

        /// <summary>
        /// 注册类型
        /// </summary>
        /// <typeparam name="TInterface">接口</typeparam>
        /// <typeparam name="TImplementation">子类</typeparam>
        void Register<TInterface, TImplementation>() where TInterface : class where TImplementation : class;

        /// <summary>
        /// 注册类型
        /// </summary>
        /// <typeparam name="TImplementation">类</typeparam>
        void Register< TImplementation>() where TImplementation : class;
        /// <summary>
        /// 注册集合中所有的类型
        /// </summary>
        /// <param name="types"></param>
        void Register(List<Type> types);

        /// <summary>
        /// 获取实例
        /// </summary>
        /// <typeparam name="T"></typeparam>
        /// <returns></returns>
        T GetService<T>();

    }
}
